home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tmhost2.zip / SCREENIO.SCR < prev    next >
Text File  |  1990-12-22  |  5KB  |  210 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; SCREENIO toolbox
  3. ; use #include "SCREENIO.SCR" in source file
  4.  
  5. integer EchoTolocal, EchoToRemote, ANSILOCAL, ANSIREMOTE
  6.  
  7. ; set EchoToLocal, EchoToRemote, ANSILOCAL or ANSIREMOTE
  8. ; in source file to either TRUE (1) or FALSE (0) depending
  9. ; on whether you wish to "print" to local screen or "put" to remote
  10. ; the Ansi variables set ANSI characters true or false
  11.  
  12. string  FGBLACK,FGBLUE,FGGREEN,FGCYAN,FGRED,FGYELLOW,FGWHITE
  13. string  BKBLACK,BKBLUE,BKGREEN,BKCYAN,BKRED,BKYELLOW,BKWHITE
  14.  
  15. FGBLACK   = "^[[30m"          ; define foreground color code in ANSI order
  16. FGRED     = "^[[31m"
  17. FGGREEN   = "^[[32m"
  18. FGYELLOW  = "^[[33m"
  19. FGBLUE    = "^[[34m"
  20. FGMAGENTA = "^[[35m"
  21. FGCYAN    = "^[[36m"
  22. FGWHITE   = "^[[37m"
  23.  
  24. BKBLACK   = "^[[40m"          ; define background color code in ANSI order
  25. BKRED     = "^[[41m"
  26. BKGREEN   = "^[[42m"
  27. BKYELLOW  = "^[[43m"
  28. BKBLUE    = "^[[44m"
  29. BKMAGENTA = "^[[45m"
  30. BKCYAN    = "^[[46m"
  31. BKWHITE   = "^[[47m"
  32.  
  33.  
  34. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  35. ;
  36. ; Echo s
  37. ; function:  print the string <s> to local screen if <EchoToLocal> is TRUE
  38. ;            and send <s> to remote system if <EchoToRemote> is TRUE.
  39. ;
  40. Procedure Echo string s
  41.   if EchoToLocal             ; print to local
  42.     print s,
  43.   endif
  44.   if EchoToRemote            ; put to remote system
  45.     put s,
  46.   endif
  47. EndProc
  48.  
  49. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  50. ;
  51. ; EchoInt i
  52. ; function: print the integer <i> to local screen if <EchoToLocal> is TRUE
  53. ;            and send <i> to remote system if <EchoToRemote> is TRUE
  54. ;
  55. Procedure EchoInt integer i
  56.   if EchoToLocal
  57.     print i,                   ; print to local screen
  58.   endif
  59.   if EchoToRemote
  60.     put i,                     ; put to remote system
  61.   endif
  62. EndProc
  63.  
  64. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  65. ;
  66. ; EchoColor color
  67. ; function: set foreground colour
  68. ;
  69. Procedure EchoColor string color  ; FGWHITE etc.
  70.   if EchoToLocal
  71.     If ANSILOCAL
  72.       print color,
  73.     else
  74.      print "",
  75.     endif
  76.   endif
  77.   if EchoToRemote
  78.     If ANSIREMOTE
  79.       put color,
  80.     else
  81.       put "",
  82.     endif
  83.   endif
  84. EndProc
  85.  
  86. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  87. ;
  88. ; EchoBkColor bkcolor
  89. ; function: set background colour
  90. ;
  91. Procedure EchoBkColor string bkcolor
  92.   if EchoToLocal
  93.     If ANSILOCAL
  94.       print bkcolor,
  95.     else
  96.      print "",
  97.     endif
  98.   endif
  99.   if EchoToRemote
  100.     If ANSIREMOTE
  101.       put bkcolor,
  102.     else
  103.       put "",
  104.     endif
  105.   endif
  106. EndProc
  107.  
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  110. ;
  111. ; EchoNormal
  112. ; function: set normal intensity and reset color to white on black
  113. ; remark:   to turn off high intensity only, you must use three
  114. ;           statements, where <foreground> and <background> are
  115. ;           foreground and background colors, because there is
  116. ;           no ANSI code to turn off high intensity.
  117. ;       EchoNomal
  118. ;       EchoColor   foreground
  119. ;       EchoBkColor background
  120. ;
  121. Procedure EchoNormal
  122.   if ANSILOCAL
  123.     Echo "^[[0m"                     ; ANSI code <esc>[0]
  124.   else
  125.     Echo ""
  126.   endif
  127.   if ANSIREMOTE
  128.     Echo "^[[0m"
  129.   else
  130.     Echo ""
  131.   endif
  132. EndProc
  133.  
  134.  
  135. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  136. ;
  137. ; EchoHiLite
  138. ; function: set high intensity
  139. ;
  140. Procedure EchoHiLite
  141.   if ANSILOCAL
  142.     Echo "^[[1m"                ; ANSI code <esc>[1m
  143.   else
  144.     Echo ""
  145.   endif
  146.   if ANSIREMOTE
  147.     Echo "^[[1m"
  148.   else
  149.     Echo ""
  150.   endif
  151. EndProc
  152.  
  153.  
  154. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  155. ;
  156. ; EchoBlink
  157. ; function: set blink attribute
  158. ;
  159. Procedure EchoBlink
  160.   if ANSILOCAL
  161.     Echo "^[[5m"               ; ANSI code <esc>[5m
  162.   else
  163.     Echo ""
  164.   endif
  165.   if ANSIREMOTE
  166.     Echo "^[[5m"
  167.   else
  168.     Echo ""
  169.   endif
  170. EndProc
  171.  
  172.  
  173. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  174. ;
  175. ; EchoReverse
  176. ; function: set reverse attribute
  177. ;
  178. Procedure EchoReverse
  179. if ANSILOCAL
  180.     Echo "^[[7m"                ; ANSI code <esc>[7m
  181.   else
  182.     Echo ""
  183.   endif
  184.   if ANSIREMOTE
  185.     Echo "^[[7m"
  186.   else
  187.     Echo ""
  188.   endif
  189. EndProc
  190.  
  191.  
  192. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  193. ;
  194. ; EchoClearScreen
  195. ; function: clear screen and home cursor
  196. ;
  197. Procedure EchoClearScreen
  198. if ANSILOCAL
  199.     Echo "^[[2J"                ; ANSI code <esc>[2J
  200.   else
  201.     Echo ""
  202.   endif
  203.   if ANSIREMOTE
  204.     Echo "^[[2J"
  205.   else
  206.     Echo ""
  207.   endif
  208. EndProc
  209.  
  210.